# import os
# def recognize_text(image_file, is_chinese):
#     ocr_exe = r"D:\Program Files\Tesseract-OCR\tesseract.exe"
#     output = "./output"
#     command = ocr_exe +"" + image_file +"" + output
#     if is_chinese:
#         command += "-l chi_sim"
#     os.system(command)
#     result = open("./output.txt").read()
#     return result
#
# image_path = "./code2.png"
# result = recognize_text(image_path,False)
# print(result)


from PIL import Image
import pytesseract
img=Image.open("./code2.png")
str=pytesseract.image_to_string(img,lang="eng")
print(str)

